<?php
function genarate_page_static_url($type = 'introduction') {
    if($type == 'introduction')
        return '/gioi-thieu.html';
    elseif($type == 'hosting')
        return '/hosting.html';
    elseif($type == 'contact') 
        return '/lien-he.html';
    elseif($type == 'tkw') 
        return '/thiet-ke-web.html';
    elseif($type == 'ga') 
        return '/dich-vu-google-adword.html';
    elseif($type == 'tuw') 
        return '/dich-vu-toi-uu-web.html';
    elseif($type == 'seo') 
        return '/dich-vu-seo-web.html';
    elseif($type == 'h') 
        return '/dich-vu-hosting.html';
    elseif($type == 'd') 
        return '/dich-vu-domain.html';
}

function generate_cat_link_system_url($link) {
    return '/he-thong-link/' .removeTitle($link['cat_name']). '-' .$link['cat_id']. '/';
}
function generate_detail_link_system_url($link) {
    return '/he-thong-link/' .removeTitle($link['lin_title']). '-' .$link['lin_id']. '/';
}
function removeTitle($string,$keyReplace = "/"){
	 $string = removeSign($string);
	 $string  =  trim(preg_replace("/[^A-Za-z0-9]/i"," ",$string)); // khong dau
	 $string  =  str_replace(" ","-",$string);
	 $string = str_replace("--","-",$string);
	 $string = str_replace("--","-",$string);
	 $string = str_replace("--","-",$string);
	 $string = str_replace("--","-",$string);
	 $string = str_replace("--","-",$string);
	 $string = str_replace("--","-",$string);
	 $string = str_replace("--","-",$string);
	 $string = str_replace($keyReplace,"-",$string);
	 return strtolower($string);
}
?>